<%@ LANGUAGE="VBSCRIPT" %>
<%'  ------------------------------------------------------------
  '  mz_viewprops.asp 
  '  ------------------------------------------------------------
  '  VCS INFO:
  '  
  '  $Revision:   1.10  $
  '  $Date:   08 Oct 1998 17:07:12  $
  '  $Author:   rurman  $
  '  $Workfile:   seccontent.asp  $
  '  ------------------------------------------------------------
  '  All Rights Reserved.  Copyright (c) 1988-1998 FileNET Corp.
  '  ------------------------------------------------------------
  '%>
<!-- #include file="islogon.asp" -->
<!-- #include file="notimpl.asp" -->

<% 
Function ConvertPermissionLevelLabel(ID)
    select case ID
        case Application("idmObjTypeUser")
            s = "User"
        case Application("idmObjTypeGroup")
            s = "Group"
    end select
    ConvertPermissionLevelLabel = s
end Function

Function ConvertPermissionLabel(ID)
    select case ID
        case Application("idmDSAccessNone")
            s = "None"
        case Application("idmDSAccessViewer")
            s = "Viewer"
        case Application("idmDSAccessAuthor")
            s = "Author"
        case Application("idmDSAccessOwner")
            s = "Owner"
        case Application("idmDSAccessAdmin")
            s = "Admin"
    end select
    ConvertPermissionLabel = s
End Function
'
' Get user credentials
'
DebugFlag = 0

ObjType = CInt(Request.QueryString("Type"))
Ident = Request.QueryString("Ident")
Update = Request.QueryString("Update")
LibraryLogonID = Session("LibraryLogonID")
set LibraryObj = Server.CreateObject("IDMObjects.Library")
LibraryObj.LogonID = LibraryLogonID
%>

<!-- Validate that this is an IDM Document Services and not an IDM Image Services 
  -->

<% 
    if LibraryObj.SystemType = Application("idmSysTypeIS") then
%>

<HTML>
    <HEAD>
        <TITLE>Redirecting you to the proper page for your library</TITLE>
        <META HttpEquiv="Refresh" Content="10; URL=propcontent.asp?Type=<%=ObjType%>&Update=<%=Update%>&Status=<%=Status%>&Library=<%Library%>&Ident=<%=Ident%>">
    </HEAD> 
    <BODY>
    <H2>Redirecting to property screen</H2>
    You are currently logged into an IDM Imaging Services library and trying to use an IDM Document Services specific page.
    We are redirecting you to the <a href="propcontent.asp?Type=<%=ObjType%>&Update=<%=Update%>&Status=<%=Status%>&Library=<%Library%>&Ident=<%=Ident%>">
    proper page</a>.
    </BODY>
</HTML>

<%
    'We don't want to display any more, because we're on the wrong page
    Response.End
    end if
%>

<!-- Display the properties of the document 
   -
   - Currently not working.
   -
   -->

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html">
<meta name="GENERATOR" content="">
<title>Property View</title>
</head>

<body bgcolor="#FFFFFF">

<%
set Users = LibraryObj.Users
set Groups = LibraryObj.Groups
set FObj = LibraryObj.GetObject(ObjType, Ident)

%>

<table border="0" cellpadding="4" cellspacing="0">
    <tr>
        <td nowrap>
        <% if ObjType = Application("idmObjTypeDocument") then %>
        <img src="images/ldoc.gif" width="34" height="39">
        <% else %>
        <img src="images/lfolder.gif" width="38" height="39">
        <% end if %>
        <font size="3"><strong><%= Ident %> : <%=Server.HTMLEncode(FObj.Label) %></strong></font>
        </td>
    </tr>
</table>



<% 
set ACL = FObj.permissions
%>

<table border="0" cellpadding="0" cellspacing="1">
    <tr>
    <td>&nbsp;</td>
    <td colspan=4>
    </td>
    <td align=right nowrap>
    </td>
    </tr>
    <tr>
        <td align="center" width="30">&nbsp;</td>
        <td align="center" width="200" bgcolor="#EECCFF"><font size="3"><strong>Name</strong></font></td>
        <td align="center" width="200" bgcolor="#EECCFF"><font size="3"><strong>Type</strong></font></td>
        <td align="center" width="200" bgcolor="#EECCFF"><font size="3"><strong>Access Level</strong></font></td>
    </tr>
    
    <% 'Print ACLs
    for i=1 to ACL.Count
        set Permission = ACL(i)
    %>  
    <tr>
    <td valign=bottom align=right></td>
    <td valign=bottom><em><%= Server.HTMLEncode(Permission.GranteeName) %></em></td>
    <td valign=bottom><em><%= Server.HTMLEncode(ConvertPermissionLevelLabel(Permission.GranteeType)) %></em></td>
    <td valign=bottom><em><%= Server.HTMLEncode(ConvertPermissionLabel(Permission.Access)) %></em></td>
    </tr>
    <% next %>

</table>
<hr>
<table border="0" cellpadding="0" cellspacing="1">
    <tr>
    <td width="30" valign=bottom align=right></td>
    <td>
    <% if not IsVirtual then %>
    <a target="_top" href="property.asp?Ident=<%=Ident%>&Type=<%=ObjType%>"><img alt="View Properties" src="images/prop2.gif" align=bottom border=0 width=47 height=43></a><em><strong>View Properties</strong></em>
    <%
        
        CanModify = true
        if ObjType = Application("idmObjTypeFolder") then
            CanModify = FObj.GetState(Application("idmFolderCanModify"))
        elseif ObjType = Application("idmObjTypeDocument") then
            CanModify = FObj.GetState(Application("idmDocCanModifyProperties"))
        end if
        ' display the Modify Security button only if user has access rights
        if CanModify then
    %>
    
    <a target="_top" href="security.asp?Ident=<%=Ident%>&Type=<%=ObjType%>&Modify=1"><img alt="Modify Security" src="images/lockbut.gif" align=bottom border=0 width=47 height=43></a><em><strong>Modify Security</strong></em>
    <% 
        end if
    end if %>
    </td>
    </tr>
</table>

</body>
</html>
